package org.tinygroup.fizzbuzzwhizz;

/**
 * Created by luoguo on 2014/5/6.
 */
public class IncludeNumberReader extends AbstractNumberReader {
    private String title;
    private char num;

    public IncludeNumberReader(int priority,int num, String title) {
        super(priority, true);
        this.num = (char) ('0' + num);
        this.title = title;
    }

    public boolean read(int number) {
        if (Integer.toString(number).indexOf(num) >= 0) {
            System.out.print(title);
            return true;
        }
        return false;
    }
}
